home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / C++ AppleLink Messages / CPlus.Dev$ 12⁄22⁄89 / 0024-Re What gives here?-Dec89 < prev    next >
Encoding:
Text File  |  1989-12-20  |  1.3 KB  |  36 lines  |  [TEXT/GEOL]

  1. Item    8646736                         18-Dec-89        05:25
  2.  
  3. From:   SCHMUCKER1                      Schmucker, Kurt
  4.  
  5. To:     D2022                           Strata, Gary Bringhurst,PRT
  6.  
  7. cc:     CPLUS.APPLE$                    C++ Interest List--Apple Employees
  8.         CPLUS.DEV$                      C++ Interest List--Developers
  9.         NASSI                           Nassi, Ike
  10.  
  11. Sub:    Re: What gives here?
  12.  
  13. Gary,
  14.  
  15.     This is what I believe is happening in your code (but I am still a C++
  16. novice):
  17.  
  18.     There are two "overs" in your code: overriding and overloading.  Bjarne
  19. made the decision that overriding is stronger than overloading, hence
  20. overriding a foo method in a derived class hides ALL foos in any ancestor
  21. classes, regardless of their parameter lists.  Apparently, (as your example
  22. shows), if you override all the foos, then it works out correctly.
  23.  
  24.     Don't you just love it when a language has fun, little quirky interactions
  25. like this between features?
  26.  
  27.     I also found this principle of "overriding is stronger than overloading"
  28. puzzling and in the current working draft definition of the next version of
  29. Object Pascal, we have these two concepts orthogonal, and thus, overriding
  30. foo(int) does not hide foo(real) or foo(string).
  31.  
  32.  
  33. Kurt Schmucker
  34. Apple Computer
  35.  
  36.